package behavioralPatterns.mediator;

public class Main {
    public static void main(String[] args){
        AbstractColleague collA = new ColleagueA();
        AbstractColleague collB = new ColleagueB();
        AbstractMediator mediator = new Mediator(collA, collB);

        //通过A影响B
        collA.setNumber(1000, mediator);
        System.out.println("A的值为：" + collA.getNumber());
        System.out.println("B的值为：" + collB.getNumber());

        //通过B影响A
        collB.setNumber(1000, mediator);
        System.out.println("A的值为：" + collA.getNumber());
        System.out.println("B的值为：" + collB.getNumber());

    }
}
